
package cesdentalrecord.dao.view;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import cesdentalrecord.dao.Student;
import cesdentalrecord.dao.StudentPeer;
import cesdentalrecord.dao.controller.AddDMFXConditionController;

public class AddDMFXConditionView {

	public void displayAcknowledgement(){
		System.out.println("DMFX record successfully added.");
	}
	
	public void sendAddDMFXRequest(int studentID, int tooth, String status, String date) throws IOException {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		
				AddDMFXConditionController dmfx = new AddDMFXConditionController();
				AddDMFXConditionView view = new AddDMFXConditionView();    
				String surname;
				String firstname;
				String mi;
				//int tooth;
				//String status;
				//String date;
				boolean test1 = true;
				boolean test2= true;
				boolean test3= true;
				boolean test4= true;
				boolean test5= true;
				boolean test6= true;
				boolean test7= true;
				boolean test8= true;
				//boolean test;
				
			/*	System.out.println("input Surname: ");
				surname=input.readLine();
				
				System.out.println("input Firstname: ");
				firstname=input.readLine();
				
				System.out.println("input Middle Initial: ");
				mi=input.readLine();
				
				Student s = StudentPeer.searchUser(surname, firstname, mi);
				if(s != null) {
				//tooth 5 (temporary)
				System.out.println("input Date of exam: ");
				date=input.readLine();
				
				for(tooth = 55; tooth >= 51; tooth--) {
					
					System.out.println("Enter tooth status for" + tooth + ":");
					status=input.readLine();
				
					test1 = dmfx.validateDMFXEntries(s.getStudentID(), tooth, status,date);
				}
				//tooth 6 (temporary)
				for(tooth = 61; tooth <= 65; tooth++) {
					
					System.out.println("Enter tooth status for" + tooth + ":");
					status=input.readLine();
				
					test2 = dmfx.validateDMFXEntries(s.getStudentID(), tooth, status,date);
				}
				//tooth 1 (permanent)
				for(tooth = 18; tooth >= 11; tooth--) {
				
					System.out.println("Enter tooth status for" + tooth + ":");
					status=input.readLine();
				
					test3 = dmfx.validateDMFXEntries(s.getStudentID(), tooth, status,date);
				}
				//tooth 2 (permanent)
				for(tooth = 21; tooth <= 28; tooth++) {
					
					System.out.println("Enter tooth status for" + tooth + ":");
					status=input.readLine();
				
					test4 = dmfx.validateDMFXEntries(s.getStudentID(), tooth, status,date);
				}
				//tooth 4 (temporary)
				for(tooth = 48; tooth >= 41; tooth--) {
					
					System.out.println("Enter tooth status for" + tooth + ":");
					status=input.readLine();
				
					test5 = dmfx.validateDMFXEntries(s.getStudentID(), tooth, status,date);
				}
				//tooth 3 (temporary)
				for(tooth = 31; tooth <= 38; tooth++) {
					
					System.out.println("Enter tooth status for" + tooth + ":");
					status=input.readLine();
				
					test6 = dmfx.validateDMFXEntries(s.getStudentID(), tooth, status,date);
				}
				//tooth 8 (permanent)
				for(tooth = 85; tooth >= 81; tooth--) {
					
					System.out.println("Enter tooth status for" + tooth + ":");
					status=input.readLine();
				
					test7 = dmfx.validateDMFXEntries(s.getStudentID(), tooth, status,date);
				}
				//tooth 7 (permanent)
				for(tooth = 71; tooth <= 75; tooth++) {
					
					System.out.println("Enter tooth status for" + tooth + ":");
					status=input.readLine();
				
				test8 = dmfx.validateDMFXEntries(s.getStudentID(), tooth, status,date);
				}
			}
				else {
				System.out.println("Student not found");	
				}
		*/		
				dmfx.validateDMFXEntries(studentID, tooth, status,date);
				
		if(test1 == true && test2 == true && test3 == true && test4 == true && test5 == true && test6 == true && test7 == true && test8 == true)	
			
			view.displayAcknowledgement();
		}
	}

